import { createRouter, createWebHistory } from 'vue-router'
import LoginView from '../views/LoginView.vue'
import HomeView from '../views/HomeView.vue'
import ProcessingT from '../components/type_1/ProcessingApp.vue'
import EquipmentBrowser from '../components/type_2/EquipmentBrowse.vue'
import AddEquipment from '../components/type_2/EquipmentAdd.vue'
import CompletedT from '../components/type_1/CompletedApp.vue'
import ProcessingP from '../components/type_0/Processing_project.vue'
import CompletedP from '../components/type_0/Completed_project.vue'
import infoP from '../components/type_0/ProjectInfo.vue'
import infoPview from '../components/type_0/InfoView.vue'
import CreateProject from '../components/type_0/CreateProject.vue'
import CreateParameter from '../components/type_0/CreateParameter.vue'
import CreateParameterSub from '../components/type_0/CreateParameter_sub.vue'
import Standardinfo from '../components/type_0/StandardInfo.vue'
import EditParameter from '../components/type_1/editParameter.vue'
import ViewParameter from '../components/type_1/viewParameter.vue'
import infoQ from '../components/type_3/ProjectInfo.vue'
import infoQview from '../components/type_3/InfoView.vue'
import ConfirmingQ from '../components/type_3/WaitacceptApp.vue'
import ConfirmedQ from '../components/type_3/AcceptedApp.vue'
import StandardInfoQ from '../components/type_3/StandardInfo.vue'
import EditEquipment from '@/components/type_2/editEquipment.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/api',
      name: 'api',
      component: LoginView
    },
    {
      path: '',
      name: 'login',
      component: LoginView
    },
    {
      path: '/home',
      name: 'home',
      component: HomeView,
      children: [
        {
          path: 'processingT',
          name: 'processingT',
          component: ProcessingT
        },
        {
          path: 'editParameter/:id',
          name: 'editParameter',
          component: EditParameter
        },
        {
          path: 'equipment',
          name: 'equipment',
          component: EquipmentBrowser
        },
        {
          path: 'editEquipment/:id',
          name: 'editEquipment',
          component: EditEquipment
        },
        {
          path: 'addequipment',
          name: 'addequipment',
          component: AddEquipment
        },
        {
          path: 'completedT',
          name: 'completedT',
          component: CompletedT
        },
        {
          path: 'processingP',
          name: 'processingP',
          component: ProcessingP
        },
        {
          path: 'infoP/:id',
          name: 'infoP',
          component: infoP,
          children: [
            {
              path: ':_id',
              component: infoPview
            },
            {
              path: 'st',
              component: Standardinfo
            }
          ]
        },
        {
          path: 'infoT/:id',
          name: 'infoT',
          component: ViewParameter
        },
        {
          path: 'infoQ/:id',
          name: 'infoQ',
          component: infoQ,
          children: [
            {
              path: ':_id',
              component: infoQview
            },
            {
              path: 'st',
              component: StandardInfoQ
            }
          ]
        },
        {
          path: 'completedP',
          name: 'completedP',
          component: CompletedP
        },
        {
          path: 'createProject',
          name: 'createProject',
          component: CreateProject
        },
        {
          path: 'createParameter/:id',
          name: 'createParameter',
          component: CreateParameter,
          children: [
            {
              path: ':_id',
              component: CreateParameterSub
            }
          ]
        },
        {
          path: 'confirmingQ',
          name: 'confirmingQ',
          component: ConfirmingQ
        },
        {
          path: 'confirmedQ',
          name: 'confirmedQ',
          component: ConfirmedQ
        }
      ]
    }
  ]
})

export default router
